﻿<?php
defined('_JEXEC') or die(); 
$user = &JFactory::getUser();

?>
<style>
	tbody td {font-size: 11px;}
	.extra-adminlist strong { color:#025A8D; font-size: 1.2em; font-weight: bold; }
table.extra-adminlist .extra-adminlist-tr td {background: #F7F7F7; }
	.check {
		cursor: pointer;
		-moz-box-shadow:inset 0px 1px 0px 0px #dcecfb;
		-webkit-box-shadow:inset 0px 1px 0px 0px #dcecfb;
		box-shadow:inset 0px 1px 0px 0px #dcecfb;
		background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #bddbfa), color-stop(1, #80b5ea) );
		background:-moz-linear-gradient( center top, #bddbfa 5%, #80b5ea 100% );
		filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bddbfa', endColorstr='#80b5ea');
		background-color:#bddbfa;
		-moz-border-radius:6px;
		-webkit-border-radius:6px;
		border-radius:6px;
		border:1px solid #84bbf3;
		display:inline-block;
		color:#ffffff;
		font-family:arial;
		font-size:12px;
		font-weight:bold;
		padding:4px 10px;
		text-decoration:none;
		text-shadow:1px 1px 0px #528ecc;
}.check:hover {
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #80b5ea), color-stop(1, #bddbfa) );
	background:-moz-linear-gradient( center top, #80b5ea 5%, #bddbfa 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80b5ea', endColorstr='#bddbfa');
	background-color:#80b5ea;
}.check:active {
	position:relative;
	top:1px;
}
	a.check:hover {text-decoration: none;}
.clip_button {
border:1px solid #d1dcdf; -webkit-border-radius: 3px; 
-moz-border-radius: 3px;border-radius: 3px;font-family:arial, helvetica, sans-serif;
 padding: 10px 0; text-shadow: -1px -1px 0 rgba(78,54,194,0.3);
 font-weight:bold; text-align: center; color: #1C1C1A; 
 background-color: #f2f5f6;
 background-image: -webkit-gradient(linear, left top, left bottom, from(#f2f5f6), to(#c8d7dc));
 background-image: -webkit-linear-gradient(top, #f2f5f6, #c8d7dc);
 background-image: -moz-linear-gradient(top, #f2f5f6, #c8d7dc);
 background-image: -ms-linear-gradient(top, #f2f5f6, #c8d7dc);
 background-image: -o-linear-gradient(top, #f2f5f6, #c8d7dc);
 background-image: linear-gradient(to bottom, #f2f5f6, #c8d7dc);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#f2f5f6, endColorstr=#c8d7dc);
 cursor:pointer;
 }
.clip_button:hover {
	 border:1px solid #b6c7cc; background-color: #d4dee1;
 background-image: -webkit-gradient(linear, left top, left bottom, from(#d4dee1), top(#a9c0c8));
 background-image: -webkit-linear-gradient(top, #d4dee1, #a9c0c8);
 background-image: -moz-linear-gradient(top, #d4dee1, #a9c0c8);
 background-image: -ms-linear-gradient(top, #d4dee1, #a9c0c8);
 background-image: -o-linear-gradient(top, #d4dee1, #a9c0c8);
 background-image: linear-gradient(to bottom, #d4dee1, #a9c0c8);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#d4dee1, endColorstr=#a9c0c8);
} 
   #tbl_filter{
        margin: 0 ; padding: 0 ;
    }
    #tbl_filter td{
        padding: 3px;
    }
    #tbl_filter input, #tbl_filter img {
        float: left;
        margin: 0 5px 0 0;
        width: auto;
    }
    table.adminlist tbody tr td { padding: 8px 8px; }
    table.adminlist thead th { padding: 8px; }
</style>

<link rel="stylesheet" type="text/css" href="<?php echo JURI::root(); ?>js/multiselect/jquery.multiselect.css" />
<link rel="stylesheet" type="text/css" href="<?php echo JURI::root(); ?>js/multiselect/jquery-ui.css" />
<script type="text/javascript" src="<?php echo JURI::root();?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo JURI::root();?>js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo JURI::root();?>js/multiselect/jquery.multiselect.js"></script>
<!-- Copy to Clip Board -->
<script type="text/javascript" src="<?php echo JURI::root();?>administrator/components/com_wrd/assets/flash/ZeroClipboard.js"></script>
<!-- End copy to clipboard -->
<script language="JavaScript">
///copy to clip
/*Su dung copy to Clip board co hack code 2 cho.-->	
	1->trong file /administrator/components/com_wrd/assets/flash/ZeroClipboard.js ,bien moviePath dong 8 
	2->Trong file /administrator/templates/bluestork/index.php. Trong the body them onload="init(); 
	//Neu update core joomla ma ko chay thi check lai 2 cho tren :) 
	Comment by : Hung.Phan
*/	

	var clip = null;
   function $(id) { return document.getElementById(id); }

   function init() 
   {
      clip = new ZeroClipboard.Client();
      clip.setHandCursor( true );
   }

   function move_swf(ee)
   {    
      copything = document.getElementById(ee.id+"_text").value;
      
	  clip.setText(copything);

         if (clip.div)
		 {	  
            clip.receiveEvent('mouseout', null);
            clip.reposition(ee.id);
			
         }
         else{ clip.glue(ee.id); }
 
         clip.receiveEvent('mouseover', null);
 
   }    
   
</script>
<script language="javascript" type="text/javascript">
    function submitform(pressbutton){
        var form = document.adminForm ;
        //alert(pressbutton)
        if (pressbutton)
        {
            form.task.value=pressbutton ;
        }
        if ((pressbutton=='send_redemp_notice_email')||(pressbutton=='send_redemp_pick_up_notice')){
              form.controller.value="reports" ;
        }
        form.submit();
    }    
</script>
<script type="text/javascript">
    jQuery(function(){
		jQuery("a.check").click(function(){
			var id = jQuery(this).attr('rel');
			
			jQuery("#check"+id).hide();
			jQuery("#loading_"+id).show();
			
			jQuery.ajax({
				url: "index.php?option=com_wrd&controller=reports&task=checkProfileUser",
				type: "GET",
				data: 'num='+id,
				success: function (res) {
					if(res) {
						jQuery("#loading_"+id).hide();
						jQuery("#total"+id).text(res).css({"color":"000","font-weight":"bold"});
					}
					else {
						alert("Error");
						jQuery("#loading_"+id).hide();
						jQuery("#total"+id).text("Error").css({"color":"red","font-weight":"bold"});
					}
				}		
			});
		});
    });
</script>

<div class="col width-100">    
 <div id="editcell">
<form id="adminForm" action="<?php echo JRoute::_("index.php?option=com_wrd&controller=report")?>" method="post" name="adminForm" >			
<table width="100%" class="adminlist extra-adminlist">
  <thead>
    <tr class="extra-adminlist-tr" >
        <th nowrap="nowrap"><strong>Order</strong></th>
		<th nowrap="nowrap" style="text-align: left;"><strong>The question to check</strong></th>                   
		<th nowrap="nowrap"><strong>Total</strong></th>	
		<th nowrap="nowrap"><strong>Action</strong></th>
		<th nowrap="nowrap"><strong>SQL Statement</strong></th>		
		
    </tr>
  </thead>
  <tbody>
		<tr valign="middle"  valign="top" class="row0">
			<td width="5%">1</td>
			<td>Có User_id trong bảng profile nhưng không có trong bảng User</td>
			<td align="center"><span id="total1"></span></td>
			<td width="10%" align="center">
				<img class="loading" id="loading_1" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_1" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_1" rel="1"  name="check">Check<a/>
			</td> 
			
			<td align="center"><?php //echo $this->data['items1']; ?>
				<input type="hidden" id='textid1_text' value="<?php echo $this->data['items1']; ?>" />
				<div id='textid1' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
				<!--<textarea name="content1" col="30" row="20"><?php //echo $this->data["items1"]; ?></textarea>-->
			
			</td>
		</tr>
		<tr valign="middle" valign="top" class="row1">
			<td width="5%">2</td>
			<td>Có Member_id trong bảng transaction nhưng không có trong bảng profile</td>
			<td align="center"><span id="total2"></span></td>
			<td width="10%" align="center">
				<img class="loading" id="loading_2" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_2" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_2" rel="2"  name="check">Check<a/>
			</td>
			<td align="center">
				<input type="hidden" id='textid2_text' value="<?php echo $this->data['items2']; ?>" />
				<div type="button" id='textid2' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
		
		<tr valign="middle" valign="top" class="row0">
			<td width="5%">3</td>
			<td>Có transaction trong bảng transaction nhưng không có điểm trong bảng point</td>
			<td align="center"><span id="total3"></span></td>
			<td width="10%" align="center">
				<img class="loading" id="loading_3" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_3" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_3" rel="3"  name="check">Check<a/>
			</td>
			<td align="center">
				<input type="hidden" id='textid3_text' value="<?php echo "1234567" ?>" />
				<div id='textid3' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
		
		<tr valign="middle" valign="top" class="row1">
			<td width="5%">4</td>
			<td>Có User_id trong bảng point nhưng không có trong bảng profile</td>
			<td align="center"><span id="total4"></span></td>
			<td width="10%" align="center">
				<img class="loading" id="loading_4" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_4" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_4" rel="4"  name="check">Check<a/>
			</td>
			
			<td align="center">
				<input type="hidden" id='textid4_text' value="<?php echo $this->data['items4']; ?>" />
				<div id='textid4' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
		<tr valign="middle" valign="top" class="row0">
			<td width="5%">5</td>
			<td>Trùng Member_id trong bảng profile</td>
			<td align="center"><span id="total5"></span></td>
			<td width="10%" align="center">
				<img class="loading" id="loading_5" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_5" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_5" rel="5"  name="check">Check<a/>
			</td>
			
			<td align="center">
			
				<input type="hidden" id='textid5_text' value="<?php echo $this->data['items5']; ?>" />
				<div id='textid5' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
		
		<tr valign="middle" valign="top" class="row1">
			<td width="5%">6</td>
			<td>Có transaction và type = 0 trong bảng point nhưng không có trong bảng transaction</td>
			<td align="center"><span id="total6"></span></td>
			<td width="10%" align="center">
				<img class="loading" id="loading_6" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_6" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_6" rel="6"  name="check">Check<a/>
			</td>
			
			<td align="center">
			
				<input type="hidden" id='textid6_text' value="<?php echo $this->data['items6']; ?>" />
				<div id='textid6' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
		<tr valign="middle" valign="top" class="row0">
			<td width="5%">7</td>
			<td>Có Record trong bảng point nhưng user_id bằng 0 hoặc bằng NULL</td>
			<td align="center"><span id="total7"></span></td>
			<td width="10%">
				<img class="loading" id="loading_7" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_7" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_7" rel="7"  name="check">Check<a/>
			</td>
			
			<td align="center">
			
				<input type="hidden" id='textid7_text' value="<?php echo $this->data['items7']; ?>" />
				<div id='textid7' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
		<tr valign="middle" valign="top" class="row0">
			<td width="5%">8</td>
			<td>transaction_id và outlet bị trùng trong bảng transaction</td>
			<td align="center"><span id="total8"></span></td>
			<td width="10%">
				<img class="loading" id="loading_8" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_8" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_8" rel="8"  name="check">Check<a/>
			</td>
			
			<td align="center">
			
				<input type="hidden" id='textid8_text' value="<?php echo $this->data['items8']; ?>" />
				<div id='textid8' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
		<tr valign="middle" valign="top" class="row0">
			<td width="5%">9</td>
			<td>Trùng email trong field p_email của bảng profile</td>
			<td align="center"><span id="total9"></span></td>
			<td width="10%">
				<img class="loading" id="loading_9" style="float:left: width: 20px;margin-top: 5px;display:none;" src="<?php echo JURI::root();?>images/loading.gif" style="margin-top: 0;" />
				<span id="save_9" style="margin-right: 8px;background: #FFF;display:none;"></span>
				<a style="float:right" class="check check_9" rel="9"  name="check">Check<a/>
			</td>
			
			<td align="center">
			
				<input type="hidden" id='textid9_text' value="<?php echo $this->data['items9']; ?>" />
				<div id='textid9' onClick='move_swf(this)' class='clip_button'>Copy SQL To Clipboard </div>
			</td>
		</tr>
  </tbody>
  <tfoot>
        <tr>
            <td colspan="16">
                <?php //echo $this->pagination->getListFooter();?>
            </td>
        </tr>
    </tfoot>
</table>
		<input type="hidden" name="controller" value="reports" />
		<input type="hidden" name="option" value="com_wrd" />
		<?php echo JHTML::_( 'form.token' ); ?>
	</form>

        </div>
        
</div>
